import React, {Component} from 'react';
import {Drawer} from 'native-base';
import SideBar from '../SideBar/SideBar';
import AppHeader from '../Header';
export default class TeoDrawer extends Component {
  constructor(props) {
    super(props);
    console.log(props);
    this.state = {
      drawer: '',
    };
  }
  closeDrawer() {
    this.drawer._root.close();
  }
  openDrawer() {
    this.drawer._root.open();
  }
  render() {
    return (
      <Drawer
        ref={ref => {
          this.drawer = ref;
        }}
        content={
          <SideBar
            navigator={this.props.navigation}
            drawer={this.openDrawer.bind(this)}
            closeDrawer={this.closeDrawer.bind(this)}
          />
        }
        onClose={() => this.closeDrawer()}>
        <AppHeader openDrawer={this.openDrawer.bind(this)} />
      </Drawer>
    );
  }
}
